package com.atguigu.srb.sms.controller;

import com.alibaba.fastjson.JSON;
import com.atguigu.srb.base.exception.Assert;
import com.atguigu.srb.base.result.R;
import com.atguigu.srb.base.result.ResponseEnum;
import com.atguigu.srb.common.utils.RandomUtils;
import com.atguigu.srb.common.utils.RegexValidateUtils;
import com.atguigu.srb.sms.service.SmsService;
import com.atguigu.srb.sms.utils.HttpUtils;
import io.swagger.annotations.ApiOperation;
import org.apache.http.HttpResponse;
import org.apache.http.util.EntityUtils;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;

@RestController

@RequestMapping("/admin/sms")
public class SmsController {
    @Resource
    StringRedisTemplate stringRedisTemplate;
    @Resource
    SmsService smsService;
    @ApiOperation("发送短信验证码")
    @GetMapping("sendMsg/{mobile}")
    public R sendMsg(@PathVariable("mobile")String mobile){
       smsService.sendMsg(mobile);
        return R.ok();
    }
}
